<template>
    <div>
        <div class="table-title">
          原料管理查看
        </div>
        <div class="table-padding">
            <br>
            <table class="table" border="0" cellspacing="0" cellpadding="0">
                <tbody>
                   <tr>
                       <th width="15%">原料编号</th>
                       <td>{{details.no}}</td>
                   </tr>
                   <tr>
                       <th width="15%">原料名称</th>
                       <td>{{details.name}}</td>
                   </tr>
                   <tr>
                       <th width="15%">原料拼音</th>
                       <td>{{details.pinyin}}</td>
                   </tr>
                   <tr>
                       <th width="15%">原料简码</th>
                       <td>{{details.spell}}</td>
                   </tr>
                   <tr>
                       <th width="15%">类别名称</th>
                       <td>{{details.categoryId}}</td>
                   </tr>
                   <tr>
                       <th width="15%">规格型号</th>
                       <td>{{details.goodsSpec}}</td>
                   </tr>
                   <tr>
                       <th width="15%">库存单位</th>
                       <td>{{details.unit}}</td>
                   </tr>
                   <tr>
                       <th width="15%">最低库存</th>
                       <td>{{details.minStock}}</td>
                   </tr>
                   <tr>
                       <th width="15%">最高库存</th>
                       <td>{{details.maxStock}}</td>
                   </tr>
                   <tr>
                       <th width="15%">储存方式</th>
                       <td>{{details.storeMode}}</td>
                   </tr>
                   <tr>
                       <th width="15%">最新采购单价</th>
                       <td>{{details.purchaseNewPrice}}</td>
                   </tr>
                   <tr>
                       <th width="15%">消耗单位</th>
                       <td>{{details.consumeUnit}}</td>
                   </tr>
                   <tr>
                       <th width="15%">消耗单位换算值</th>
                       <td>{{details.consumeRates}}</td>
                   </tr>
                   <tr>
                       <th width="15%">成本卡标准价</th>
                       <td>{{details.orderPriceBom}}</td>
                   </tr>
                   <tr>
                       <th width="15%">订货类型</th>
                       <td>{{details.orderType}}</td>
                   </tr>
                   <tr>
                       <th width="15%">盘点类型</th>
                       <td>{{details.stocktakeType}}</td>
                   </tr>
                   <tr>
                       <th width="15%">状态</th>
                       <td>{{details.state}}</td>
                   </tr>
                </tbody>
            </table>
            <br>
            <el-button size="small" type="success" @click="goBack()">返回</el-button>
        </div>
    </div>
</template>
<script>
    //注意路径
    export default{
        data(){
            return {
                details:{}
            }
        },
        created(){
            window.this = this;
            this.$axios.get("materials/"+this.$route.query.id).then((data)=>{
                if(data.status==200){
                    this.details=data.content;
                }else{
                    this.$message.error(data.message);
                }
            })
        },
        methods: {
            goBack() {
                this.router.go(-1);
            }
        }
    }
</script>
<style scoped>

</style>
